<template>
  <el-select
    style="width: 100px"
    v-model="locale"
    placeholder="请选择语言"
    @change="changeLanguage"
  >
    <el-option :label="t('中文')" value="zhCn" />
    <el-option :label="t('英文')" value="en" />
  </el-select>
</template>

<script setup lang="ts">
import { useI18n } from 'vue-i18n'
const { t, locale } = useI18n()

import { useGlobyStory } from '@/stores/useGlobyStory'
const { setLanguage } = useGlobyStory()
const changeLanguage = (val: string) => {
  setLanguage(val)
}
</script>

<style scoped lang="scss"></style>
